package com.java.runnable.exer2;

/**
 * @author shkstart
 * @create 2021-01-28 11:01
 */
public class Test_1 implements Runnable {

    @Override
    public void run() {
        double x = 1;
        double sum = 0;
        for (int i = 1; i < 10000; i++) {
            if (i % 2 == 0) {
                sum -= 1 / x;
            } else {
                sum += 1 / x;

            }
            x += 2;
        }
        System.out.println(String.format("%.2f", sum));

    }
}
